<meta charset="utf-8">
<style>
        .layui-layer-title{
            height: 30px!important;
            line-height: 30px!important;
        }
        .lay-box{
            border: 1px #dfdfdf solid;
            width: 98%;
            /*height: 100%;*/
            margin: 0 auto;
            padding-bottom:5px;
        }
        
        .lay-box .lay-submit{
            background: #01AAED;
            padding: 0.5rem 3rem;
            color: white;
            border-radius: 6px;
            margin-top: 1.2rem;
        }
        ul{list-style:none;padding: 10px;font-size: 12px;}
        li{padding:0;}
        .lileft{width: 130px;text-align:right;height:30px;line-height: 30px;color: #909090;float:left;}
        .liright{height:30px;line-height:30px;vertical-align:middle;}
        .btn{width:100%;text-align:center;}
        .layui-btn{text-align:center;background-color:#369CDA;color:#FFF;height: 35px;margin:0 auto;display:inline-block;width:100px;}
    </style>
<form action="{:url('addmsg')}" method="post" class="ajaxform">

    <div class="lay-box">
    <ul>
        <li>
            <div class="lileft">内容简述</div>
            <div class="liright">
                <span class="textbox" style="width:300px;">
                    <input  type="text"  autocomplete="off"  placeholder="" name="name" style="margin-left:5px; height: 24px; line-height: 24px; width:305px;">
                </span>
            </div>
        </li>
        
        <li>
            <div class="lileft">详细内容</div>
            <div class="liright" style="height:auto;">
                    <textarea placeholder="" name="content" style="width:305px;height:150px;text-indent:10px;line-height:20px;margin-left:5px;">
                    </textarea>
            </div>
        </li>
        
        <li >
            <div class="lileft">状态</div>
            <div class="liright">
              <input type="radio" id="open" name="is_auto" value="1" title="开启" checked=""><label for="open">开启</label>
              <input type="radio" id="close" name="is_auto" value="0" title="关闭"><label for="close">关闭</label>
            </div>
        </li>
    </ul>
    <div class="btn">
        <button class="layui-btn">提交</button>
    </div>
</div>
</form>

<script src="__resource_path__/libs/jquery/jquery-1-4ed679c998.11.3.min.js"></script>
<script src="__static_path__/js/layer/layer.js"></script>
<script type="text/javascript">
$('#btnSubmit').click(function(){
    $('.ajaxform').submit();
})
$('.ajaxform').submit(function(e){
     e.preventDefault();
     var form = $(this).serialize();
     $.post('{:url("addmsg")}',form,function(data){
           if (data.success==true) {
              layer.msg(data.errorMsg);
              window.parent.location.reload();
           }
     })
})

</script>


